import React, { useRef, useState } from 'react'

function UseFd(com) {
    const timer=useRef(null)
  return ()=>{
    clearInterval(timer.current)
    function fd (...arg){
        timer.current=setInterval(() => {
            com(...arg)
        }, 1000);
    }
    return fd
  }
}

export default UseFd
